package com.pth.admin.action;

import com.opensymphony.xwork2.ActionSupport;
import com.pth.model.News;
import com.pth.service.NewsService;
import com.pth.utils.timeUtil;

public class AddNewsAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private NewsService newsService;
	
	public NewsService getNewsService() {
		return newsService;
	}

	public void setNewsService(NewsService newsService) {
		this.newsService = newsService;
	}

	public News getNews() {
		return news;
	}

	public void setNews(News news) {
		this.news = news;
	}

	private News news;
	
	@Override
	public String execute() throws Exception {
		
		news.setNewspublishtime(timeUtil.getCurrentDate());
		newsService.add(news);
		return SUCCESS;
	}
	
	
}
